#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtGui>

class QCamera;
class QCameraInfo;
class QGraphicsVideoItem;
class QGraphicsView;
class QGraphicsScene;
class QGridLayout;
class QVBoxLayout;
class QPushButton;
class QRadioButton;
class QTabWidget;
class QResizeEvent;
class QFont;
class QGraphicsSimpleTextItem;
class QTranslator;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void resizeEvent(QResizeEvent *event);

private slots:
    void startCamera();
    void addHat();
    void addMustache();
    void addText();
    void delItem();
    void selectChinese();
    void selectEnglish();
    void capture();

private:
    bool checkCamera() const;
    void retranslateUi();

    QWidget *mainWidget;
    QGridLayout *mainLayout;
    QVBoxLayout *iconLayout;
    QVBoxLayout *langLayout;
    QPushButton *captureButton;
    QPushButton *hatButton;
    QPushButton *mustacheButton;
    QPushButton *textButton;
    QPushButton *delButton;
    QRadioButton *enButton;
    QRadioButton *chsButton;
    QTabWidget *captureWidget;
    QWidget *iconWidget;
    QWidget *langWidget;
    bool hasCamera;
    QCamera *camera;
    QGraphicsVideoItem *videoItem;
    QGraphicsView *view;
    QGraphicsScene *scene;
    QFont *font;
    QGraphicsSimpleTextItem * warningItem;
    QTranslator* translator;
};

#endif // MAINWINDOW_H
